<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>regist</title>
</head>
<body>

<div id="regist">
<h1>注册页面</h1>
    <form method="POST">   <!-- method 方法 post -->
        {% csrf_token %}

        <!--  {{ csrf_token }} 是防止网站被跨域攻击的 -->
        <p><input type="text" placeholder="用户名" name="username" id="username"></br></p>
        <p><input type="password" placeholder="第一次输入密码" name="password" id="password"></br></p>
        <p><input type="password" placeholder="第二次输入密码" name="password2" id="password2"></br></p>
        <p><input type="text" placeholder="手机号" name="phone" id="phone"></br></p>
        <p><input type="submit" name="注册" id="submit" value="注册"></br></p>
        <p class="text-danger text-center" style="color:#e75252">{{ error }}</p>
        <p><a href="/">返回登录界面</a></p><br>
    </form>
</div>
</body>
</html>

<style>
    body, p, div, ul, li, h1, h2, h3, h4, h5, h6 {
        margin: 0;
        padding: 0;
    }

    body {
        background: #E9E9E9;
    }

    #regist {
        width: 25%;
        height: 60%;
        background: #FFF;
        margin: 10% auto;
        position: relative;
    }

    #regist h1 {
        text-align: center;
        position: absolute;
        left: 131px;
        top: -50px;
        /*font-size: 21px;*/
    }

    #regist form p {
        text-align: center;
    }

    #username {
        background: rgba(0, 0, 0, .1) no-repeat;
        width: 200px;
        height: 30px;
        border: solid #ccc 1px;
        border-radius: 3px;
        padding-left: 32px;
        margin-top: 50px;
        margin-bottom: 30px;
    }

    #password {
        background: rgba(0, 0, 0, .1) no-repeat;
        width: 200px;
        height: 30px;
        border: solid #ccc 1px;
        border-radius: 3px;
        padding-left: 32px;
        margin-bottom: 30px;
    }

    #password2 {
        background: rgba(0, 0, 0, .1) no-repeat;
        width: 200px;
        height: 30px;
        border: solid #ccc 1px;
        border-radius: 3px;
        padding-left: 32px;
        margin-bottom: 30px;
    }

    #phone {
        background: rgba(0, 0, 0, .1) no-repeat;
        width: 200px;
        height: 30px;
        border: solid #ccc 1px;
        border-radius: 3px;
        padding-left: 32px;
        margin-bottom: 30px;
    }

    #submit {
        width: 116px;
        height: 30px;
        background: rgba(0, 0, 0, .1);
        border: solid #ccc 1px;
        border-radius: 3px;
    }

    #submit:hover {
        cursor: pointer;
        background: #D8D8D8;
    }
</style>
